package com.yhl.vocation.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yhl.vocation.entity.pojo.Admin;
import com.yhl.vocation.entity.vo.TeachVo;
import com.yhl.vocation.service.AdminService;
import com.yhl.vocation.mapper.AdminMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author acompe
* @description 针对表【admin(管理员账户)】的数据库操作Service实现
* @createDate 2023-03-14 01:11:19
*/
@Service
public class AdminServiceImpl extends ServiceImpl<AdminMapper, Admin>
    implements AdminService{

    @Override
    public Admin login(String username, String password) {
        return getBaseMapper().selectOne(new LambdaQueryWrapper<Admin>().eq(Admin::getUsername,username).eq(Admin::getPassword,password));
    }

    @Override
    public List<Admin> listTeach(int i) {
        return getBaseMapper().selectList(new LambdaQueryWrapper<Admin>().eq(Admin::getType, i));
    }

    @Override
    public List<TeachVo> listTech() {
        return getBaseMapper().listTeach();
    }
}




